<?php

declare(strict_types=1);

namespace App\Model\Shop;

use App\Model\Model;
use App\Traits\Model\Shop\Shop as ShopTraits;
use Hyperf\ModelCache\Cacheable;
use Hyperf\ModelCache\CacheableInterface;

/**
 * @property int $id 
 * @property string $name 店铺名称
 * @property string $prov 省
 * @property string $city 市
 * @property string $area 区
 * @property string $address 详细地址
 * @property int $status 店铺状态|{"1":"审核中","2":"开启","3":"关闭"}
 * @property string $close_reason 关闭原因
 * @property string $end_date 店铺截止日期
 * @property string $logo 店铺LOGO
 * @property string $seo_keyword 店铺SEO关键字
 * @property string $seo_desc 店铺SEO描述
 * @property string $mobile 店铺手机号码
 * @property int $sale 店铺销量
 * @property int $inventory_alert 库存预警
 * @property string $service_mobile 服务电话,用于接收通知信息
 * @property string $notice 店铺公告
 * @property string $order_prefix 订单号码前缀
 * @property string $default_user_head 用户默认头像
 * @property string $pay_customs_area 支付报关
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $deleted_at 
 */
class Shop extends Model implements CacheableInterface
{
    use ShopTraits, Cacheable;

    /**
     * The table associated with the model.
     */
    protected ?string $table = 'shop';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'name', 'prov', 'city', 'area', 'address', 'status', 'close_reason', 'end_date', 'logo', 'seo_keyword', 'seo_desc', 'mobile', 'sale', 'inventory_alert', 'service_mobile', 'notice', 'order_prefix', 'default_user_head', 'pay_customs_area', 'created_at', 'updated_at', 'deleted_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'status' => 'integer', 'sale' => 'integer', 'inventory_alert' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    /**
     * 自动新增
     * @var array|int[]
     */
    public array $insert = [
        'status' => 2,
    ];
}
